package com.gonsin.ta.logic.exceptions;

import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;

public class TaException extends RuntimeException{

    private String message;

    public TaException(String content, Object ... args){
        if(args == null || args.length == 0){
            this.message = content;
            return;
        }
        FormattingTuple ft = MessageFormatter.arrayFormat(content, args);
        this.message = ft.getMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }
}
